<!--道具标签-->
<script setup>
import {ref, toRefs} from "vue";
import {useStore} from "vuex";
import ItemTabPane from "@/components/item/ItemTabPane.vue";
import {ItemType} from "@ginstone/nga-api/dist/src/enums/ItemType";

const props = defineProps({
  //如果传入表示对用户使用道具
  userId: Number,
  //如果传入表示对回复
  topicId: Number,
  //如果传入表示对回复
  replyId: Number,
  // 指定道具类型
  itemType: ItemType,
  // 初始激活的tab
  tab: String,
})
const {userId, topicId, replyId, tab} = toRefs(props)
const store = useStore();
const activeTab = ref(tab.value || "item_inventory");
</script>

<template>
  <el-tabs v-model="activeTab">
    <el-tab-pane label="库存" lazy name="item_inventory">
      <item-tab-pane :item-type="itemType" :reply-id="replyId" :topic-id="topicId" :user-id="userId" tab="inventory"/>
    </el-tab-pane>
    <el-tab-pane label="商店" lazy name="item_store">
      <item-tab-pane :item-type="itemType" :reply-id="replyId" :topic-id="topicId" :user-id="userId" tab="store"/>
    </el-tab-pane>
  </el-tabs>
</template>

<style scoped>

</style>